﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace Kooboo.Commerce
{
    public static class Configuration
    {
        public static string ConnectionString = "KoobooCommerce";

        public static string FindConnection()
        {
            return FindConnection(Configuration.ConnectionString);
        }

        public static string FindConnection(string name)
        {
            return ConfigurationManager.ConnectionStrings[name].ConnectionString;
        }

        public static string DefaultPassword = "Kooboo2010";

        public static string AppRootUrl = "/commerce/";

        public static string AppRootPath = "\\areas\\commerce\\";

        public static string ImageFolderName = "images";

        public static string BrandLogoFolder = "brand";

        public static string ProductImageFolder = "product";

        public static string CategoryPhotoFolder = "category";

        /// <summary>
        /// image path for default detail image
        /// </summary>
        public static String ImageNotAvailable_Detail = "/images/no-image.jpg";

        /// <summary>
        /// image path for default thumbnail image
        /// </summary>
        public static String ImageNotAvailable_Thumbnail = "/images/no-image.png";

        public static int PageSize = 25;

        public static string ScriptFolder = "~/areas/commerce/";

        /// <summary>
        /// 
        /// </summary>
        /// <param name="folderName">alias name for image folder</param>
        /// <param name="sizeName">alias name for image size</param>
        /// <returns></returns>
        public static string FindImageUrlBase(string folderName, string sizeName)
        {
            return Configuration.AppRootPath.Replace("\\", "/") + Configuration.ImageFolderName + "/" + folderName + "/" + sizeName + "/";
        }
    }
}
